fix(rollup-plugin): Fix relative paths on Windows env#1573
fix(rollup-plugin): Fix relative paths on Windows env#1573jussirantala wants to merge 9 commits intovanilla-extract-css:masterfrom
rollup-plugin): Fix relative paths on Windows env#1573Conversation
|
|
@jussirantala Could you try and recreate the issue in a test case or raise an issue with a minimal reproduction? I can't manage to get |
@askoufis I'll try to find time for that but what do you mean with rollup preventing emitting files to relative paths? You just need to have something being imported from a upper directory. For example you could import some classes in your styling file from |
|
So you were using Windows when you tested, right? |
|
@jussirantala I'm still not able to reproduce what you're talking about. This was my attempt to understand you situation. I made a nested entrypoint in a package that imports a file from a parent directory. The relative path looks correct to me. This is why it would be very helpful if you could create a minimal reproduction of the issue in a repo so I can test it out. Alternative, if you fork the repo and create a failing test case then that would also be useful so I can validate your solution. |
@askoufis It's pointing to current directory instead of the upper directory. |
@jussirantala Once again, I'd greatly appreciate if you could make a minimal reproduction of your specific issue, instead of me trying to blindly reproduce it. |
|
Thanks for testing it. I will try to find out time for the minimal repro. |
All relative paths were resolved to current dir
./even though they should be for example../on Windows 11 and it was caused becausechunkInfo.fileNamehad backward slashes\instead of forward slashes/. This caused broken builds.Looks like
normalizeorrelativedoesn't work with backward slashes so the bug was fixed with replacing Windows separator with posix separator. On posix system it just replaces posix separator with posix sep again so Mac or Linux is not affected (I tested on Mac).